package com.example.demo.redis;

import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.concurrent.TimeUnit;

@RestController
public class RedisController {


    @Resource
    private RedisTemplate redisTemplate;

    @GetMapping("/redis")
    public void test() {
        redisTemplate.opsForValue().set("order:1212", "12121", 30, TimeUnit.SECONDS);
    }


}
